<?php

    function UnitTableRowDelete( tStringArray $values, tInteger $curpage, tBoolean $emptytable ) {
        global $table;

        $values = $values->Get();
        $curpage = $curpage->Get();
        $change = $table->DeleteRow( $values );

        if ( !$change->Impact() ) {
            ?>alert( 'Deleting row failed!' );<?php
        }

        if ( $emptytable->Get() ) {
            --$curpage;
        }

        ?>var tablebrowse = g( 'tablebrowse' );<?php

        ob_start();
        Element( 'table/browse/view', $curpage );
        $html = ob_get_clean();
        
        ?>var newTableBrowse = d.createElement( 'div' );
        newTableBrowse.id = 'tablebrowse';
        newTableBrowse.innerHTML = <?php
        echo w_json_encode( $html );
        ?>;
        
        tablebrowse.parentNode.insertBefore( newTableBrowse, tablebrowse );
        tablebrowse.parentNode.removeChild( tablebrowse );<?php
    }

?>
